<template>
  <div :class="className" :style="{height:height,width:width}" />
</template>

<script>
/* eslint-disable */
  import echarts from 'echarts'
  import 'echarts/extension/bmap/bmap'
  require('echarts/theme/macarons') // echarts theme
  import { debounce } from '@/utils'
  import 'echarts/map/js/china'
  export default {
    props: {
      className: {
        type: String,
        default: 'chart'
      },
      width: {
        type: String,
        default: '100%'
      },
      height: {
        type: String,
        default: '480px'
      },
      autoResize: {
        type: Boolean,
        default: true
      },
      stackData: {
        type: Object,
        required: true
      }
    },
    data() {
      return {
        chart: null,
        sidebarElm: null
      }
    },
    watch: {
      trendData: {
        deep: true,
        handler(val) {
          this.setOptions(val)
        }
      }
    },
    mounted() {
      this.$nextTick(() => {
        this.initChart()
      })
      if (this.autoResize) {
        this.__resizeHandler = debounce(() => {
          if (this.chart) {
            this.chart.resize()
          }
        }, 100)
        window.addEventListener('resize', this.__resizeHandler)
      }

      // 监听侧边栏的变化
      this.sidebarElm = document.getElementsByClassName('sidebar-container')[0]
      this.sidebarElm && this.sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler)
    },
    beforeDestroy() {
      if (!this.chart) {
        return
      }
      if (this.autoResize) {
        window.removeEventListener('resize', this.__resizeHandler)
      }

      this.sidebarElm && this.sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler)

      this.chart.dispose()
      this.chart = null
    },
    methods: {
      sidebarResizeHandler(e) {
        if (e.propertyName === 'width') {
          this.__resizeHandler()
        }
      },
      convertData(data) {
        const geoCoordMap = {
          '海门': [121.15, 31.89],
          '鄂尔多斯': [109.781327, 39.608266],
          '招远': [120.38, 37.35],
          '舟山': [122.207216, 29.985295],
          '齐齐哈尔': [123.97, 47.33],
          '盐城': [120.13, 33.38],
          '赤峰': [118.87, 42.28],
          '青岛': [120.33, 36.07],
          '乳山': [121.52, 36.89],
          '金昌': [102.188043, 38.520089],
          '泉州': [118.58, 24.93],
          '莱西': [120.53, 36.86],
          '日照': [119.46, 35.42],
          '胶南': [119.97, 35.88],
          '南通': [121.05, 32.08],
          '拉萨': [91.11, 29.97],
          '云浮': [112.02, 22.93],
          '梅州': [116.1, 24.55],
          '文登': [122.05, 37.2],
          '上海': [121.48, 31.22],
          '攀枝花': [101.718637, 26.582347],
          '威海': [122.1, 37.5],
          '承德': [117.93, 40.97],
          '厦门': [118.1, 24.46],
          '汕尾': [115.375279, 22.786211],
          '潮州': [116.63, 23.68],
          '丹东': [124.37, 40.13],
          '太仓': [121.1, 31.45],
          '曲靖': [103.79, 25.51],
          '烟台': [121.39, 37.52],
          '福州': [119.3, 26.08],
          '瓦房店': [121.979603, 39.627114],
          '即墨': [120.45, 36.38],
          '抚顺': [123.97, 41.97],
          '玉溪': [102.52, 24.35],
          '张家口': [114.87, 40.82],
          '阳泉': [113.57, 37.85],
          '莱州': [119.942327, 37.177017],
          '湖州': [120.1, 30.86],
          '汕头': [116.69, 23.39],
          '昆山': [120.95, 31.39],
          '宁波': [121.56, 29.86],
          '湛江': [110.359377, 21.270708],
          '揭阳': [116.35, 23.55],
          '荣成': [122.41, 37.16],
          '连云港': [119.16, 34.59],
          '葫芦岛': [120.836932, 40.711052],
          '常熟': [120.74, 31.64],
          '东莞': [113.75, 23.04],
          '河源': [114.68, 23.73],
          '淮安': [119.15, 33.5],
          '泰州': [119.9, 32.49],
          '南宁': [108.33, 22.84],
          '营口': [122.18, 40.65],
          '惠州': [114.4, 23.09],
          '江阴': [120.26, 31.91],
          '蓬莱': [120.75, 37.8],
          '韶关': [113.62, 24.84],
          '嘉峪关': [98.289152, 39.77313],
          '广州': [113.23, 23.16],
          '延安': [109.47, 36.6],
          '太原': [112.53, 37.87],
          '清远': [113.01, 23.7],
          '中山': [113.38, 22.52],
          '昆明': [102.73, 25.04],
          '寿光': [118.73, 36.86],
          '盘锦': [122.070714, 41.119997],
          '长治': [113.08, 36.18],
          '深圳': [114.07, 22.62],
          '珠海': [113.52, 22.3],
          '宿迁': [118.3, 33.96],
          '咸阳': [108.72, 34.36],
          '铜川': [109.11, 35.09],
          '平度': [119.97, 36.77],
          '佛山': [113.11, 23.05],
          '海口': [110.35, 20.02],
          '江门': [113.06, 22.61],
          '章丘': [117.53, 36.72],
          '肇庆': [112.44, 23.05],
          '大连': [121.62, 38.92],
          '临汾': [111.5, 36.08],
          '吴江': [120.63, 31.16],
          '石嘴山': [106.39, 39.04],
          '沈阳': [123.38, 41.8],
          '苏州': [120.62, 31.32],
          '茂名': [110.88, 21.68],
          '嘉兴': [120.76, 30.77],
          '长春': [125.35, 43.88],
          '胶州': [120.03336, 36.264622],
          '银川': [106.27, 38.47],
          '张家港': [120.555821, 31.875428],
          '三门峡': [111.19, 34.76],
          '锦州': [121.15, 41.13],
          '南昌': [115.89, 28.68],
          '柳州': [109.4, 24.33],
          '三亚': [109.511909, 18.252847],
          '自贡': [104.778442, 29.33903],
          '吉林': [126.57, 43.87],
          '阳江': [111.95, 21.85],
          '泸州': [105.39, 28.91],
          '西宁': [101.74, 36.56],
          '宜宾': [104.56, 29.77],
          '呼和浩特': [111.65, 40.82],
          '成都': [104.06, 30.67],
          '大同': [113.3, 40.12],
          '镇江': [119.44, 32.2],
          '桂林': [110.28, 25.29],
          '张家界': [110.479191, 29.117096],
          '宜兴': [119.82, 31.36],
          '北海': [109.12, 21.49],
          '西安': [108.95, 34.27],
          '金坛': [119.56, 31.74],
          '东营': [118.49, 37.46],
          '牡丹江': [129.58, 44.6],
          '遵义': [106.9, 27.7],
          '绍兴': [120.58, 30.01],
          '扬州': [119.42, 32.39],
          '常州': [119.95, 31.79],
          '潍坊': [119.1, 36.62],
          '重庆': [106.54, 29.59],
          '台州': [121.420757, 28.656386],
          '南京': [118.78, 32.04],
          '滨州': [118.03, 37.36],
          '贵阳': [106.71, 26.57],
          '无锡': [120.29, 31.59],
          '本溪': [123.73, 41.3],
          '克拉玛依': [84.77, 45.59],
          '渭南': [109.5, 34.52],
          '马鞍山': [118.48, 31.56],
          '宝鸡': [107.15, 34.38],
          '焦作': [113.21, 35.24],
          '句容': [119.16, 31.95],
          '北京': [116.46, 39.92],
          '徐州': [117.2, 34.26],
          '衡水': [115.72, 37.72],
          '包头': [110, 40.58],
          '绵阳': [104.73, 31.48],
          '乌鲁木齐': [87.68, 43.77],
          '枣庄': [117.57, 34.86],
          '杭州': [120.19, 30.26],
          '淄博': [118.05, 36.78],
          '鞍山': [122.85, 41.12],
          '溧阳': [119.48, 31.43],
          '库尔勒': [86.06, 41.68],
          '安阳': [114.35, 36.1],
          '开封': [114.35, 34.79],
          '济南': [117, 36.65],
          '德阳': [104.37, 31.13],
          '温州': [120.65, 28.01],
          '九江': [115.97, 29.71],
          '邯郸': [114.47, 36.6],
          '临安': [119.72, 30.23],
          '兰州': [103.73, 36.03],
          '沧州': [116.83, 38.33],
          '临沂': [118.35, 35.05],
          '南充': [106.110698, 30.837793],
          '天津': [117.2, 39.13],
          '富阳': [119.95, 30.07],
          '泰安': [117.13, 36.18],
          '诸暨': [120.23, 29.71],
          '郑州': [113.65, 34.76],
          '哈尔滨': [126.63, 45.75],
          '聊城': [115.97, 36.45],
          '芜湖': [118.38, 31.33],
          '唐山': [118.02, 39.63],
          '平顶山': [113.29, 33.75],
          '邢台': [114.48, 37.05],
          '德州': [116.29, 37.45],
          '济宁': [116.59, 35.38],
          '荆州': [112.239741, 30.335165],
          '宜昌': [111.3, 30.7],
          '义乌': [120.06, 29.32],
          '丽水': [119.92, 28.45],
          '洛阳': [112.44, 34.7],
          '秦皇岛': [119.57, 39.95],
          '株洲': [113.16, 27.83],
          '石家庄': [114.48, 38.03],
          '莱芜': [117.67, 36.19],
          '常德': [111.69, 29.05],
          '保定': [115.48, 38.85],
          '湘潭': [112.91, 27.87],
          '金华': [119.64, 29.12],
          '岳阳': [113.09, 29.37],
          '长沙': [113, 28.21],
          '衢州': [118.88, 28.97],
          '廊坊': [116.7, 39.53],
          '菏泽': [115.480656, 35.23375],
          '合肥': [117.27, 31.86],
          '武汉': [114.31, 30.52],
          '大庆': [125.03, 46.58],
          '林芝地': [94.25, 29.59],
          '果洛藏族自治': [97.42, 34.81],
          '闵行': [121.23, 31.07],
          '那曲地': [92.1, 31.47]
        }
        var res = []
        for (var i = 0; i < data.length; i++) {
          var geoCoord = geoCoordMap[data[i].name]
          if (geoCoord) {
            res.push({
              name: data[i].name,
              value: geoCoord.concat(data[i].value)
            })
          }
        }
        return res
      },
      /* convertData(data) {
        const geoCoordMap = {
          '海门': [121.15, 31.89],
          '鄂尔多斯': [109.781327, 39.608266],
          '招远': [120.38, 37.35],
          '舟山': [122.207216, 29.985295],
          '齐齐哈尔': [123.97, 47.33],
          '盐城': [120.13, 33.38],
          '赤峰': [118.87, 42.28],
          '青岛': [120.33, 36.07],
          '乳山': [121.52, 36.89],
          '金昌': [102.188043, 38.520089],
          '泉州': [118.58, 24.93],
          '莱西': [120.53, 36.86],
          '日照': [119.46, 35.42],
          '胶南': [119.97, 35.88],
          '南通': [121.05, 32.08],
          '拉萨': [91.11, 29.97],
          '云浮': [112.02, 22.93],
          '梅州': [116.1, 24.55],
          '文登': [122.05, 37.2],
          '上海': [121.48, 31.22],
          '攀枝花': [101.718637, 26.582347],
          '威海': [122.1, 37.5],
          '承德': [117.93, 40.97],
          '厦门': [118.1, 24.46],
          '汕尾': [115.375279, 22.786211],
          '潮州': [116.63, 23.68],
          '丹东': [124.37, 40.13],
          '太仓': [121.1, 31.45],
          '曲靖': [103.79, 25.51],
          '烟台': [121.39, 37.52],
          '福州': [119.3, 26.08],
          '瓦房店': [121.979603, 39.627114],
          '即墨': [120.45, 36.38],
          '抚顺': [123.97, 41.97],
          '玉溪': [102.52, 24.35],
          '张家口': [114.87, 40.82],
          '阳泉': [113.57, 37.85],
          '莱州': [119.942327, 37.177017],
          '湖州': [120.1, 30.86],
          '汕头': [116.69, 23.39],
          '昆山': [120.95, 31.39],
          '宁波': [121.56, 29.86],
          '湛江': [110.359377, 21.270708],
          '揭阳': [116.35, 23.55],
          '荣成': [122.41, 37.16],
          '连云港': [119.16, 34.59],
          '葫芦岛': [120.836932, 40.711052],
          '常熟': [120.74, 31.64],
          '东莞': [113.75, 23.04],
          '河源': [114.68, 23.73],
          '淮安': [119.15, 33.5],
          '泰州': [119.9, 32.49],
          '南宁': [108.33, 22.84],
          '营口': [122.18, 40.65],
          '惠州': [114.4, 23.09],
          '江阴': [120.26, 31.91],
          '蓬莱': [120.75, 37.8],
          '韶关': [113.62, 24.84],
          '嘉峪关': [98.289152, 39.77313],
          '广州': [113.23, 23.16],
          '延安': [109.47, 36.6],
          '太原': [112.53, 37.87],
          '清远': [113.01, 23.7],
          '中山': [113.38, 22.52],
          '昆明': [102.73, 25.04],
          '寿光': [118.73, 36.86],
          '盘锦': [122.070714, 41.119997],
          '长治': [113.08, 36.18],
          '深圳': [114.07, 22.62],
          '珠海': [113.52, 22.3],
          '宿迁': [118.3, 33.96],
          '咸阳': [108.72, 34.36],
          '铜川': [109.11, 35.09],
          '平度': [119.97, 36.77],
          '佛山': [113.11, 23.05],
          '海口': [110.35, 20.02],
          '江门': [113.06, 22.61],
          '章丘': [117.53, 36.72],
          '肇庆': [112.44, 23.05],
          '大连': [121.62, 38.92],
          '临汾': [111.5, 36.08],
          '吴江': [120.63, 31.16],
          '石嘴山': [106.39, 39.04],
          '沈阳': [123.38, 41.8],
          '苏州': [120.62, 31.32],
          '茂名': [110.88, 21.68],
          '嘉兴': [120.76, 30.77],
          '长春': [125.35, 43.88],
          '胶州': [120.03336, 36.264622],
          '银川': [106.27, 38.47],
          '张家港': [120.555821, 31.875428],
          '三门峡': [111.19, 34.76],
          '锦州': [121.15, 41.13],
          '南昌': [115.89, 28.68],
          '柳州': [109.4, 24.33],
          '三亚': [109.511909, 18.252847],
          '自贡': [104.778442, 29.33903],
          '吉林': [126.57, 43.87],
          '阳江': [111.95, 21.85],
          '泸州': [105.39, 28.91],
          '西宁': [101.74, 36.56],
          '宜宾': [104.56, 29.77],
          '呼和浩特': [111.65, 40.82],
          '成都': [104.06, 30.67],
          '大同': [113.3, 40.12],
          '镇江': [119.44, 32.2],
          '桂林': [110.28, 25.29],
          '张家界': [110.479191, 29.117096],
          '宜兴': [119.82, 31.36],
          '北海': [109.12, 21.49],
          '西安': [108.95, 34.27],
          '金坛': [119.56, 31.74],
          '东营': [118.49, 37.46],
          '牡丹江': [129.58, 44.6],
          '遵义': [106.9, 27.7],
          '绍兴': [120.58, 30.01],
          '扬州': [119.42, 32.39],
          '常州': [119.95, 31.79],
          '潍坊': [119.1, 36.62],
          '重庆': [106.54, 29.59],
          '台州': [121.420757, 28.656386],
          '南京': [118.78, 32.04],
          '滨州': [118.03, 37.36],
          '贵阳': [106.71, 26.57],
          '无锡': [120.29, 31.59],
          '本溪': [123.73, 41.3],
          '克拉玛依': [84.77, 45.59],
          '渭南': [109.5, 34.52],
          '马鞍山': [118.48, 31.56],
          '宝鸡': [107.15, 34.38],
          '焦作': [113.21, 35.24],
          '句容': [119.16, 31.95],
          '北京': [116.46, 39.92],
          '徐州': [117.2, 34.26],
          '衡水': [115.72, 37.72],
          '包头': [110, 40.58],
          '绵阳': [104.73, 31.48],
          '乌鲁木齐': [87.68, 43.77],
          '枣庄': [117.57, 34.86],
          '杭州': [120.19, 30.26],
          '淄博': [118.05, 36.78],
          '鞍山': [122.85, 41.12],
          '溧阳': [119.48, 31.43],
          '库尔勒': [86.06, 41.68],
          '安阳': [114.35, 36.1],
          '开封': [114.35, 34.79],
          '济南': [117, 36.65],
          '德阳': [104.37, 31.13],
          '温州': [120.65, 28.01],
          '九江': [115.97, 29.71],
          '邯郸': [114.47, 36.6],
          '临安': [119.72, 30.23],
          '兰州': [103.73, 36.03],
          '沧州': [116.83, 38.33],
          '临沂': [118.35, 35.05],
          '南充': [106.110698, 30.837793],
          '天津': [117.2, 39.13],
          '富阳': [119.95, 30.07],
          '泰安': [117.13, 36.18],
          '诸暨': [120.23, 29.71],
          '郑州': [113.65, 34.76],
          '哈尔滨': [126.63, 45.75],
          '聊城': [115.97, 36.45],
          '芜湖': [118.38, 31.33],
          '唐山': [118.02, 39.63],
          '平顶山': [113.29, 33.75],
          '邢台': [114.48, 37.05],
          '德州': [116.29, 37.45],
          '济宁': [116.59, 35.38],
          '荆州': [112.239741, 30.335165],
          '宜昌': [111.3, 30.7],
          '义乌': [120.06, 29.32],
          '丽水': [119.92, 28.45],
          '洛阳': [112.44, 34.7],
          '秦皇岛': [119.57, 39.95],
          '株洲': [113.16, 27.83],
          '石家庄': [114.48, 38.03],
          '莱芜': [117.67, 36.19],
          '常德': [111.69, 29.05],
          '保定': [115.48, 38.85],
          '湘潭': [112.91, 27.87],
          '金华': [119.64, 29.12],
          '岳阳': [113.09, 29.37],
          '长沙': [113, 28.21],
          '衢州': [118.88, 28.97],
          '廊坊': [116.7, 39.53],
          '菏泽': [115.480656, 35.23375],
          '合肥': [117.27, 31.86],
          '武汉': [114.31, 30.52],
          '大庆': [125.03, 46.58],
          '林芝地': [94.25, 29.59],
          '果洛藏族自治': [97.42, 34.81],
          '闵行': [121.23, 31.07],
          '那曲地': [92.1, 31.47]
        }
        const res = []
        for (let i = 0; i < 4; i++) {
          const l = data.length
          const x = parseInt(Math.random() * l)
          const geoCoord = geoCoordMap[data[x].name]
          // let geoCoord = this.geoCoordMap[data[i].name];
          if (geoCoord) {
            res.push({
              name: data[x].name,
              // name: data[x].name,
              value: geoCoord.concat(Math.random() * 200)
              // value: geoCoord.concat(data[i].value)
            })
          }
        }
        return res
        /!* var res = []
        for (var i = 0; i < data.length; i++) {
          var geoCoord = geoCoordMap[data[i].name]
          if (geoCoord) {
            res.push({
              name: data[i].name,
              value: geoCoord.concat(data[i].value)
            })
          }
        }
        return res*!/
      },*/
      setOptions() {
        /* var data = [
          { name: '海门', value: 9 },
          { name: '鄂尔多斯', value: 12 },
          { name: '招远', value: 12 },
          { name: '舟山', value: 12 },
          { name: '齐齐哈尔', value: 14 },
          { name: '盐城', value: 15 },
          { name: '赤峰', value: 16 },
          { name: '青岛', value: 18 },
          { name: '乳山', value: 18 },
          { name: '金昌', value: 19 },
          { name: '泉州', value: 21 },
          { name: '莱西', value: 21 },
          { name: '日照', value: 21 },
          { name: '胶南', value: 22 },
          { name: '南通', value: 23 },
          { name: '拉萨', value: 24 },
          { name: '云浮', value: 24 },
          { name: '梅州', value: 25 },
          { name: '文登', value: 25 },
          { name: '上海', value: 25 },
          { name: '攀枝花', value: 25 },
          { name: '威海', value: 25 },
          { name: '承德', value: 25 },
          { name: '厦门', value: 26 },
          { name: '汕尾', value: 26 },
          { name: '潮州', value: 26 },
          { name: '丹东', value: 27 },
          { name: '太仓', value: 27 },
          { name: '曲靖', value: 27 },
          { name: '烟台', value: 28 },
          { name: '福州', value: 29 },
          { name: '瓦房店', value: 30 },
          { name: '即墨', value: 30 },
          { name: '抚顺', value: 31 },
          { name: '玉溪', value: 31 },
          { name: '张家口', value: 31 },
          { name: '阳泉', value: 31 },
          { name: '莱州', value: 32 },
          { name: '湖州', value: 32 },
          { name: '汕头', value: 32 },
          { name: '昆山', value: 33 },
          { name: '宁波', value: 33 },
          { name: '湛江', value: 33 },
          { name: '揭阳', value: 34 },
          { name: '荣成', value: 34 },
          { name: '连云港', value: 35 },
          { name: '葫芦岛', value: 35 },
          { name: '常熟', value: 36 },
          { name: '东莞', value: 36 },
          { name: '河源', value: 36 },
          { name: '淮安', value: 36 },
          { name: '泰州', value: 36 },
          { name: '南宁', value: 37 },
          { name: '营口', value: 37 },
          { name: '惠州', value: 37 },
          { name: '江阴', value: 37 },
          { name: '蓬莱', value: 37 },
          { name: '韶关', value: 38 },
          { name: '嘉峪关', value: 38 },
          { name: '广州', value: 38 },
          { name: '延安', value: 38 },
          { name: '太原', value: 39 },
          { name: '清远', value: 39 },
          { name: '中山', value: 39 },
          { name: '昆明', value: 39 },
          { name: '寿光', value: 40 },
          { name: '盘锦', value: 40 },
          { name: '长治', value: 41 },
          { name: '深圳', value: 41 },
          { name: '珠海', value: 42 },
          { name: '宿迁', value: 43 },
          { name: '咸阳', value: 43 },
          { name: '铜川', value: 44 },
          { name: '平度', value: 44 },
          { name: '佛山', value: 44 },
          { name: '海口', value: 44 },
          { name: '江门', value: 45 },
          { name: '章丘', value: 45 },
          { name: '肇庆', value: 46 },
          { name: '大连', value: 47 },
          { name: '临汾', value: 47 },
          { name: '吴江', value: 47 },
          { name: '石嘴山', value: 49 },
          { name: '沈阳', value: 50 },
          { name: '苏州', value: 50 },
          { name: '茂名', value: 50 },
          { name: '嘉兴', value: 51 },
          { name: '长春', value: 51 },
          { name: '胶州', value: 52 },
          { name: '银川', value: 52 },
          { name: '张家港', value: 52 },
          { name: '三门峡', value: 53 },
          { name: '锦州', value: 54 },
          { name: '南昌', value: 54 },
          { name: '柳州', value: 54 },
          { name: '三亚', value: 54 },
          { name: '自贡', value: 56 },
          { name: '吉林', value: 56 },
          { name: '阳江', value: 57 },
          { name: '泸州', value: 57 },
          { name: '西宁', value: 57 },
          { name: '宜宾', value: 58 },
          { name: '呼和浩特', value: 58 },
          { name: '成都', value: 58 },
          { name: '大同', value: 58 },
          { name: '镇江', value: 59 },
          { name: '桂林', value: 59 },
          { name: '张家界', value: 59 },
          { name: '宜兴', value: 59 },
          { name: '北海', value: 60 },
          { name: '西安', value: 61 },
          { name: '金坛', value: 62 },
          { name: '东营', value: 62 },
          { name: '牡丹江', value: 63 },
          { name: '遵义', value: 63 },
          { name: '绍兴', value: 63 },
          { name: '扬州', value: 64 },
          { name: '常州', value: 64 },
          { name: '潍坊', value: 65 },
          { name: '重庆', value: 66 },
          { name: '台州', value: 67 },
          { name: '南京', value: 67 },
          { name: '滨州', value: 70 },
          { name: '贵阳', value: 71 },
          { name: '无锡', value: 71 },
          { name: '本溪', value: 71 },
          { name: '克拉玛依', value: 72 },
          { name: '渭南', value: 72 },
          { name: '马鞍山', value: 72 },
          { name: '宝鸡', value: 72 },
          { name: '焦作', value: 75 },
          { name: '句容', value: 75 },
          { name: '北京', value: 79 },
          { name: '徐州', value: 79 },
          { name: '衡水', value: 80 },
          { name: '包头', value: 80 },
          { name: '绵阳', value: 80 },
          { name: '乌鲁木齐', value: 84 },
          { name: '枣庄', value: 84 },
          { name: '杭州', value: 84 },
          { name: '淄博', value: 85 },
          { name: '鞍山', value: 86 },
          { name: '溧阳', value: 86 },
          { name: '库尔勒', value: 86 },
          { name: '安阳', value: 90 },
          { name: '开封', value: 90 },
          { name: '济南', value: 92 },
          { name: '德阳', value: 93 },
          { name: '温州', value: 95 },
          { name: '九江', value: 96 },
          { name: '邯郸', value: 98 },
          { name: '临安', value: 99 },
          { name: '兰州', value: 99 },
          { name: '沧州', value: 100 },
          { name: '临沂', value: 103 },
          { name: '南充', value: 104 },
          { name: '天津', value: 105 },
          { name: '富阳', value: 106 },
          { name: '泰安', value: 112 },
          { name: '诸暨', value: 112 },
          { name: '郑州', value: 113 },
          { name: '哈尔滨', value: 114 },
          { name: '聊城', value: 116 },
          { name: '芜湖', value: 117 },
          { name: '唐山', value: 119 },
          { name: '平顶山', value: 119 },
          { name: '邢台', value: 119 },
          { name: '德州', value: 120 },
          { name: '济宁', value: 120 },
          { name: '荆州', value: 127 },
          { name: '宜昌', value: 130 },
          { name: '义乌', value: 132 },
          { name: '丽水', value: 133 },
          { name: '洛阳', value: 134 },
          { name: '秦皇岛', value: 136 },
          { name: '株洲', value: 143 },
          { name: '石家庄', value: 147 },
          { name: '莱芜', value: 148 },
          { name: '常德', value: 152 },
          { name: '保定', value: 153 },
          { name: '湘潭', value: 154 },
          { name: '金华', value: 157 },
          { name: '岳阳', value: 169 },
          { name: '长沙', value: 175 },
          { name: '衢州', value: 177 },
          { name: '廊坊', value: 193 },
          { name: '菏泽', value: 194 },
          { name: '合肥', value: 229 },
          { name: '武汉', value: 273 },
          { name: '大庆', value: 279 }
        ]
        const data1 = this.convertData(data)
        console.log(data1)*/
        var data = this.stackData.data/* [
        { name: '西充县', value: 100 },
        { name: '仪陇县', value: 100 },
        { name: '顺庆区', value: 100 }
      ]*/
        var geoCoordMap = this.stackData.map

        var convertData = function(data) {
          var res = []
          for (var i = 0; i < data.length; i++) {
            var geoCoord = geoCoordMap[data[i].name]
            if (geoCoord) {
              res.push({
                name: data[i].name,
                value: geoCoord.concat(data[i].value)
              })
            }
          }
          return res
        }
        const option = {
          title: {
            text: this.stackData.title,
            left: 'center'
          },
          tooltip: {
            trigger: 'item'
          },
          bmap: {
            center: [105.88, 31.00],
            zoom: 10,
            roam: true,
            mapStyle: {
              styleJson: [{
                'featureType': 'water',
                'elementType': 'all',
                'stylers': {
                  'color': '#d1d1d1'
                }
              }, {
                'featureType': 'land',
                'elementType': 'all',
                'stylers': {
                  'color': '#f3f3f3'
                }
              }, {
                'featureType': 'railway',
                'elementType': 'all',
                'stylers': {
                  'visibility': 'off'
                }
              }, {
                'featureType': 'highway',
                'elementType': 'all',
                'stylers': {
                  'color': '#fdfdfd'
                }
              }, {
                'featureType': 'highway',
                'elementType': 'labels',
                'stylers': {
                  'visibility': 'off'
                }
              }, {
                'featureType': 'arterial',
                'elementType': 'geometry',
                'stylers': {
                  'color': '#fefefe'
                }
              }, {
                'featureType': 'arterial',
                'elementType': 'geometry.fill',
                'stylers': {
                  'color': '#fefefe'
                }
              }, {
                'featureType': 'poi',
                'elementType': 'all',
                'stylers': {
                  'visibility': 'off'
                }
              }, {
                'featureType': 'green',
                'elementType': 'all',
                'stylers': {
                  'visibility': 'off'
                }
              }, {
                'featureType': 'subway',
                'elementType': 'all',
                'stylers': {
                  'visibility': 'off'
                }
              }, {
                'featureType': 'manmade',
                'elementType': 'all',
                'stylers': {
                  'color': '#d1d1d1'
                }
              }, {
                'featureType': 'local',
                'elementType': 'all',
                'stylers': {
                  'color': '#d1d1d1'
                }
              }, {
                'featureType': 'arterial',
                'elementType': 'labels',
                'stylers': {
                  'visibility': 'off'
                }
              }, {
                'featureType': 'boundary',
                'elementType': 'all',
                'stylers': {
                  'color': '#fefefe'
                }
              }, {
                'featureType': 'building',
                'elementType': 'all',
                'stylers': {
                  'color': '#d1d1d1'
                }
              }, {
                'featureType': 'label',
                'elementType': 'labels.text.fill',
                'stylers': {
                  'color': '#999999'
                }
              }]
            }
          },
          series: [
            {
              name: '上访数',
              type: 'scatter',
              coordinateSystem: 'bmap',
              data: convertData(data),
              symbolSize: function(val) {
                return val[2]
              },
              encode: {
                value: 2
              },
              label: {
                formatter: '{b}',
                position: 'right',
                show: false
              },
              itemStyle: {
                color: 'purple'
              },
              emphasis: {
                label: {
                  show: true
                }
              }
            },
            {
              name: '',
              type: 'effectScatter',
              coordinateSystem: 'bmap',
              data: convertData(data.sort(function(a, b) {
                return b.value - a.value
              }).slice(0, 6)),
              symbolSize: function(val) {
                return val[2] / 10
              },
              encode: {
                value: 2
              },
              showEffectOn: 'render',
              rippleEffect: {
                brushType: 'stroke'
              },
              hoverAnimation: true,
              label: {
                formatter: '{b}',
                position: 'right',
                show: true,
                fontSize: 14,
                fontWeight: 'bold'
              },
              itemStyle: {
                color: 'purple',
                shadowBlur: 10000,
                shadowColor: '#333',
                fontSize: '18'
              },
              zlevel: 3
            }
          ]
        }
        /* {
          tooltip: {
            trigger: 'item'
          },
          title: {
            text: 'xxxxxx(上海市)',
            x: 'center'
          },
          series: [
            {
              type: 'map',
              map: 'nanchong',
              data: [{
                name: '保山市',
                selected: true
              }]
            }
          ]
        }*/
        this.chart.setOption(option)
      },
      initChart() {
        const nanchongJson = {
          'type': 'FeatureCollection',
          'features': [{
            'type': 'Feature',
            'properties': { 'name': '高坪区', 'id': '511303' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[106.307345, 30.8938430000001], [106.297345, 30.8938430000001], [106.293922148438, 30.9060353828125], [106.285152617188, 30.8972658515625], [106.297345, 30.8938430000001], [106.302345, 30.8810353828126], [106.351539335938, 30.8760427070313], [106.37298953125, 30.85948753125], [106.394881621094, 30.8228835273438], [106.465028105469, 30.8033498359375], [106.48298953125, 30.78948753125], [106.487345, 30.7838430000001], [106.451610136719, 30.7595778632813], [106.433079863281, 30.7281081367188], [106.421610136719, 30.7195778632813], [106.413079863281, 30.6981081367188], [106.386009550781, 30.6873513007813], [106.364407988281, 30.6910695625], [106.352345, 30.7214260078126], [106.324266386719, 30.7165920234376], [106.302552519531, 30.6874001289063], [106.262178984375, 30.7177809882813], [106.209888945313, 30.7281081367188], [106.213612089844, 30.70647971875], [106.2328528125, 30.709790265625], [106.241610136719, 30.70149925], [106.211610136719, 30.6895778632813], [106.198814726563, 30.6723732734376], [106.170628691406, 30.6514089179688], [106.183470488281, 30.6082643867188], [106.1543371875, 30.5966872382813], [106.137345, 30.573843], [106.121790800781, 30.5782888007813], [106.097706328125, 30.592446515625], [106.11322390625, 30.618843], [106.101678496094, 30.6384841132813], [106.106607695313, 30.6781056953125], [106.066033964844, 30.6542555976563], [106.042899199219, 30.6762575507813], [106.087928496094, 30.7123171210938], [106.112711210938, 30.69774925], [106.121790800781, 30.7239943671875], [106.071197539063, 30.7384596992187], [106.087345, 30.763843], [106.095557890625, 30.7695143867188], [106.090472441406, 30.7921950507813], [106.121698027344, 30.8137526679688], [106.131429472656, 30.8397585273437], [106.150584746094, 30.86917503125], [106.172713652344, 30.8844533515625], [106.181868925781, 30.9425539375], [106.210716582031, 30.9679274726563], [106.253861113281, 30.9398317695313], [106.277345, 30.9738430000001], [106.303626738281, 30.9595607734375], [106.300350371094, 30.9449416328125], [106.32408328125, 30.9084963203125], [106.311429472656, 30.8997585273438], [106.307345, 30.8938430000001]]]]
            }
          }, {
            'type': 'Feature',
            'properties': { 'name': '嘉陵区', 'id': '511304' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[105.941910429688, 30.4965407539063], [105.947345, 30.4838430000001], [105.924346953125, 30.487895734375], [105.941910429688, 30.4965407539063]]], [[[105.853260527344, 30.9097585273438], [105.86509890625, 30.8926125312501], [105.892691679688, 30.91058128125], [105.90201296875, 30.8970827460938], [105.932691679688, 30.8771047187501], [105.941429472656, 30.8897585273438], [105.957345, 30.8938430000001], [105.96170046875, 30.88819846875], [105.97298953125, 30.87948753125], [105.98170046875, 30.8681984687501], [105.99298953125, 30.85948753125], [106.00170046875, 30.84819846875], [106.033162871094, 30.8293825507813], [106.029871855469, 30.80710471875], [106.087345, 30.763843], [106.071197539063, 30.7384596992187], [106.121790800781, 30.7239943671875], [106.112711210938, 30.69774925], [106.087928496094, 30.7123171210938], [106.042899199219, 30.6762575507813], [106.066033964844, 30.6542555976563], [106.106607695313, 30.6781056953125], [106.101678496094, 30.6384841132813], [106.11322390625, 30.618843], [106.097706328125, 30.592446515625], [106.121790800781, 30.5782888007813], [106.137345, 30.573843], [106.121429472656, 30.5497585273438], [106.117345, 30.533843], [106.112843046875, 30.5115480781251], [106.077345, 30.4939015937501], [106.032369414063, 30.5162575507813], [106.022345, 30.4815163398438], [106.002345, 30.49128440625], [105.992345, 30.48640159375], [105.982330351563, 30.4912917304688], [105.967345, 30.4838430000001], [105.952684355469, 30.5092726875001], [105.942345, 30.5084401679688], [105.922345, 30.5100490546875], [105.91271609375, 30.48847190625], [105.901541777344, 30.4788430000001], [105.913360625, 30.4686598945313], [105.881170683594, 30.4592140937501], [105.883524199219, 30.4885182929687], [105.870330839844, 30.4998854804688], [105.840765410156, 30.4975099921875], [105.881678496094, 30.5552150703125], [105.85197390625, 30.56847190625], [105.814920683594, 30.6114772773438], [105.79271609375, 30.70921409375], [105.781304960938, 30.7509084296875], [105.782747832031, 30.768843], [105.781219511719, 30.7878615546876], [105.792996855469, 30.8089723945313], [105.78197390625, 30.81847190625], [105.77271609375, 30.82921409375], [105.76197390625, 30.8384719062501], [105.75271609375, 30.84921409375], [105.728590117188, 30.8700026679688], [105.737345, 30.8938430000001], [105.773660917969, 30.897973859375], [105.769383574219, 30.9170583320313], [105.817867460938, 30.9279274726563], [105.853260527344, 30.9097585273438]]]]
            }
          }, {
            'type': 'Feature',
            'properties': { 'name': '南部县', 'id': '511321' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[106.167345, 31.0938430000001], [106.177345, 31.0938430000001], [106.177345, 31.073843], [106.167345, 31.073843], [106.167345, 31.0938430000001]]], [[[106.167345, 31.0938430000001], [106.150704375, 31.097202375], [106.131317167969, 31.1126052070313], [106.122320585938, 31.0814284492188], [106.083985625, 31.1004836250001], [106.067345, 31.103843], [106.062806425781, 31.1093044257812], [106.041883574219, 31.1183815742188], [106.032806425781, 31.1293044257813], [106.011883574219, 31.1383815742188], [106.002806425781, 31.1517678046875], [106.022894316406, 31.1684523750001], [106.021302519531, 31.1840651679688], [105.979178496094, 31.2100490546876], [105.962345, 31.2083327460938], [105.931568632813, 31.211469953125], [105.932855253906, 31.1988430000001], [105.931685820313, 31.1873805976563], [105.907345, 31.1898610664063], [105.820013457031, 31.1809596992188], [105.823450957031, 31.2146901679688], [105.765777617188, 31.239702375], [105.752022734375, 31.2383010078125], [105.728136015625, 31.2519802070313], [105.684212675781, 31.247505109375], [105.667345, 31.253843], [105.641065703125, 31.2675637031251], [105.628685332031, 31.2884499335938], [105.594110136719, 31.2998610664063], [105.604061308594, 31.328843], [105.600279570313, 31.3398610664063], [105.623624296875, 31.3475637031251], [105.641065703125, 31.3821486640625], [105.617335234375, 31.407563703125], [105.571612578125, 31.3866457343751], [105.561500273438, 31.4037038398438], [105.542345, 31.3971266914063], [105.532345, 31.4005593085938], [105.5146496875, 31.3944826484376], [105.473624296875, 31.4297805], [105.494542265625, 31.458843], [105.475628691406, 31.485122296875], [105.451500273438, 31.4768361640625], [105.447345, 31.483843], [105.453985625, 31.4972023750001], [105.457345, 31.533843], [105.504256621094, 31.5711965156251], [105.542345, 31.5673146796875], [105.562345, 31.5693532539063], [105.572735625, 31.5682936835938], [105.589058867188, 31.5879470039063], [105.605819121094, 31.5493044257813], [105.612806425781, 31.5583815742188], [105.634107695313, 31.6074929023438], [105.652445097656, 31.6093630195313], [105.687345, 31.603843], [105.697655058594, 31.5704567695313], [105.742166777344, 31.5585353828126], [105.752345, 31.5591408515626], [105.772345, 31.5579494453126], [105.832064238281, 31.561509015625], [105.822625761719, 31.5285622382813], [105.793121367188, 31.5150197578125], [105.812830839844, 31.47874534375], [105.792625761719, 31.4606911445313], [105.804271269531, 31.4580641914063], [105.831995878906, 31.4597170234375], [105.832940703125, 31.443843], [105.832030058594, 31.4285768867188], [105.852625761719, 31.4191237617188], [105.862254667969, 31.3981447578125], [105.880496855469, 31.4185622382812], [105.883033476563, 31.3954030585938], [105.8819934375, 31.3779274726563], [105.90259890625, 31.3791555], [105.920496855469, 31.3591237617188], [105.941041289063, 31.3751100898438], [105.960657988281, 31.4178493476563], [106.030069609375, 31.4219850898438], [106.050496855469, 31.3991237617188], [106.092625761719, 31.4085622382813], [106.131668730469, 31.4297780585938], [106.225975371094, 31.4241555], [106.272625761719, 31.4385622382813], [106.286783476563, 31.4544045234375], [106.297345, 31.463843], [106.301429472656, 31.4479274726563], [106.313260527344, 31.4397585273438], [106.321429472656, 31.4279274726563], [106.3567590625, 31.4035353828125], [106.351051054688, 31.3780690742188], [106.381429472656, 31.3667018867188], [106.371556425781, 31.3440114570313], [106.332174101563, 31.3274709296876], [106.290736113281, 31.3381056953126], [106.311429472656, 31.3873757148438], [106.256363554688, 31.3789870429688], [106.237762480469, 31.3065065742188], [106.19748171875, 31.3155373359375], [106.203465605469, 31.288843], [106.200980253906, 31.2777565742188], [106.231898222656, 31.257622296875], [106.260081816406, 31.26394065625], [106.264586210938, 31.2438430000001], [106.259132109375, 31.2195143867188], [106.267345, 31.213843], [106.274852324219, 31.1987404609375], [106.253985625, 31.157202375], [106.229300566406, 31.1500783515626], [106.235269804688, 31.1378517890625], [106.220704375, 31.130483625], [106.213985625, 31.1172023750001], [106.170704375, 31.1104836250001], [106.167345, 31.0938430000001]]]]
            }
          }, {
            'type': 'Feature',
            'properties': { 'name': '蓬安县', 'id': '511323' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[106.297345, 30.8938430000001], [106.307345, 30.8938430000001], [106.302345, 30.8810353828126], [106.297345, 30.8938430000001]]], [[[106.297345, 30.8938430000001], [106.285152617188, 30.8972658515625], [106.293922148438, 30.9060353828125], [106.297345, 30.8938430000001]]], [[[106.617345, 30.8238430000001], [106.613922148438, 30.8360353828126], [106.605152617188, 30.8272658515625], [106.611019316406, 30.8091042304688], [106.62093875, 30.7697292304688], [106.581339140625, 30.759848859375], [106.577345, 30.7438430000001], [106.532347441406, 30.7382204414062], [106.516727324219, 30.7401638007813], [106.492899199219, 30.7793971992188], [106.487345, 30.7838430000001], [106.48298953125, 30.78948753125], [106.465028105469, 30.8033498359375], [106.394881621094, 30.8228835273438], [106.37298953125, 30.85948753125], [106.351539335938, 30.8760427070313], [106.307345, 30.8938430000001], [106.311429472656, 30.8997585273438], [106.32408328125, 30.9084963203125], [106.300350371094, 30.9449416328125], [106.303626738281, 30.9595607734375], [106.277345, 30.9738430000001], [106.265184355469, 30.9901930976563], [106.252345, 30.9879811835938], [106.242345, 30.9897048164063], [106.185648222656, 30.9799416328125], [106.203277617188, 31.0084279609375], [106.201385527344, 31.0194118476563], [106.214066191406, 31.028843], [106.183350859375, 31.0516921210938], [106.177345, 31.073843], [106.177345, 31.0938430000001], [106.167345, 31.0938430000001], [106.170704375, 31.1104836250001], [106.213985625, 31.1172023750001], [106.220704375, 31.130483625], [106.235269804688, 31.1378517890625], [106.229300566406, 31.1500783515626], [106.253985625, 31.157202375], [106.274852324219, 31.1987404609375], [106.267345, 31.213843], [106.279947539063, 31.2284719062501], [106.3027746875, 31.2191921210938], [106.30080203125, 31.1946413398437], [106.334718046875, 31.2340090156251], [106.362066679688, 31.2492678046876], [106.372640410156, 31.2484181953125], [106.40306765625, 31.2699904609376], [106.432345, 31.2676369453125], [106.452381621094, 31.2692482734376], [106.507345, 31.263843], [106.502625761719, 31.2285622382812], [106.492064238281, 31.2191237617188], [106.482625761719, 31.1985622382813], [106.433509550781, 31.1833962226563], [106.431048613281, 31.1420827460937], [106.456783476563, 31.1132814765626], [106.473043242188, 31.0987526679688], [106.442625761719, 31.0847927070313], [106.480047636719, 31.0204347968751], [106.565482207031, 31.0071218085938], [106.582064238281, 30.9885622382813], [106.592940703125, 30.9788430000001], [106.57115359375, 30.9593752265626], [106.5826575, 30.94909690625], [106.581485625, 30.9294289375], [106.625806914063, 30.9175588203125], [106.652545195313, 30.9191530585937], [106.667345, 30.913843], [106.683861113281, 30.8888503242187], [106.671124296875, 30.8692897773438], [106.673529082031, 30.8585646796875], [106.667345, 30.843843], [106.661329375, 30.8351296210938], [106.617345, 30.8238430000001]]]]
            }
          }, {
            'type': 'Feature',
            'properties': { 'name': '顺庆区', 'id': '511302' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[106.167345, 31.0938430000001], [106.167345, 31.073843], [106.177345, 31.073843], [106.183350859375, 31.0516921210938], [106.214066191406, 31.028843], [106.201385527344, 31.0194118476563], [106.203277617188, 31.0084279609375], [106.185648222656, 30.9799416328125], [106.242345, 30.9897048164063], [106.252345, 30.9879811835938], [106.265184355469, 30.9901930976563], [106.277345, 30.9738430000001], [106.253861113281, 30.9398317695313], [106.210716582031, 30.9679274726563], [106.181868925781, 30.9425539375], [106.172713652344, 30.8844533515625], [106.150584746094, 30.86917503125], [106.131429472656, 30.8397585273437], [106.121698027344, 30.8137526679688], [106.090472441406, 30.7921950507813], [106.095557890625, 30.7695143867188], [106.087345, 30.763843], [106.029871855469, 30.80710471875], [106.033162871094, 30.8293825507813], [106.00170046875, 30.84819846875], [105.99298953125, 30.85948753125], [105.98170046875, 30.8681984687501], [105.97298953125, 30.87948753125], [105.96170046875, 30.88819846875], [105.957345, 30.8938430000001], [105.962987089844, 30.9186818671875], [105.9609778125, 30.93483909375], [106.015577421875, 30.95784690625], [106.010535917969, 30.9983888984375], [106.022899199219, 31.0082888007813], [106.063441191406, 31.0750368476563], [106.061688261719, 31.089126203125], [106.067345, 31.103843], [106.083985625, 31.1004836250001], [106.122320585938, 31.0814284492188], [106.131317167969, 31.1126052070313], [106.150704375, 31.097202375], [106.167345, 31.0938430000001]]]]
            }
          }, {
            'type': 'Feature',
            'properties': { 'name': '西充县', 'id': '511325' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[105.667345, 31.253843], [105.684212675781, 31.247505109375], [105.728136015625, 31.2519802070313], [105.752022734375, 31.2383010078125], [105.765777617188, 31.239702375], [105.823450957031, 31.2146901679688], [105.820013457031, 31.1809596992188], [105.907345, 31.1898610664063], [105.931685820313, 31.1873805976563], [105.932855253906, 31.1988430000001], [105.931568632813, 31.211469953125], [105.962345, 31.2083327460938], [105.979178496094, 31.2100490546876], [106.021302519531, 31.1840651679688], [106.022894316406, 31.1684523750001], [106.002806425781, 31.1517678046875], [106.011883574219, 31.1383815742188], [106.032806425781, 31.1293044257813], [106.041883574219, 31.1183815742188], [106.062806425781, 31.1093044257812], [106.067345, 31.103843], [106.061688261719, 31.089126203125], [106.063441191406, 31.0750368476563], [106.022899199219, 31.0082888007813], [106.010535917969, 30.9983888984375], [106.015577421875, 30.95784690625], [105.9609778125, 30.93483909375], [105.962987089844, 30.9186818671875], [105.957345, 30.8938430000001], [105.941429472656, 30.8897585273438], [105.932691679688, 30.8771047187501], [105.90201296875, 30.8970827460938], [105.892691679688, 30.91058128125], [105.86509890625, 30.8926125312501], [105.853260527344, 30.9097585273438], [105.817867460938, 30.9279274726563], [105.769383574219, 30.9170583320313], [105.773660917969, 30.897973859375], [105.737345, 30.8938430000001], [105.729771757813, 30.9088137031251], [105.700704375, 30.9172023750001], [105.678873320313, 30.9345436835938], [105.657345, 30.923843], [105.653260527344, 30.9397585273438], [105.641429472656, 30.9479274726563], [105.617345, 30.983843], [105.62197390625, 30.99921409375], [105.6627746875, 31.0084841132812], [105.6619153125, 31.0191970039063], [105.700401640625, 31.030786359375], [105.713829375, 31.0753786445313], [105.711541777344, 31.103843], [105.713951445313, 31.133843], [105.711317167969, 31.166626203125], [105.662733183594, 31.1812526679687], [105.682996855469, 31.1987136054688], [105.67197390625, 31.21847190625], [105.667345, 31.253843]]]]
            }
          }, {
            'type': 'Feature',
            'properties': { 'name': '仪陇县', 'id': '511324' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[106.407345, 31.6638430000001], [106.450479765625, 31.646469953125], [106.453084746094, 31.6288430000001], [106.451605253906, 31.618843], [106.453084746094, 31.608843], [106.450699492188, 31.5927028632813], [106.48298953125, 31.5794875312501], [106.501954375, 31.5680471015625], [106.535479765625, 31.5730007148438], [106.55298953125, 31.55948753125], [106.566912871094, 31.50948753125], [106.630523710938, 31.5215138984376], [106.634561796875, 31.5488430000001], [106.630667753906, 31.5751930976563], [106.641832304688, 31.5896584296876], [106.652345, 31.5881032539063], [106.673436308594, 31.5912209296875], [106.670282011719, 31.5698854804688], [106.682345, 31.5681032539063], [106.702345, 31.5710597968751], [106.732345, 31.5666262031251], [106.773658476563, 31.5727321601562], [106.768836699219, 31.5401003242188], [106.782345, 31.5381032539063], [106.813658476563, 31.5427321601563], [106.809967070313, 31.5177516914063], [106.82490359375, 31.5199611640625], [106.837345, 31.5038430000001], [106.841073027344, 31.4520754218751], [106.864295683594, 31.440327375], [106.874793730469, 31.4188283515625], [106.867345, 31.403843], [106.831519804688, 31.3996681953125], [106.823170195313, 31.3880178046875], [106.805601835938, 31.3754274726563], [106.78252078125, 31.3900807929688], [106.746827421875, 31.3754103828125], [106.764925566406, 31.3469020820312], [106.760831328125, 31.3261794257813], [106.741724882813, 31.3299538398438], [106.712965117188, 31.289829328125], [106.656112089844, 31.3010622382813], [106.589522734375, 31.2808351875], [106.572965117188, 31.2577321601563], [106.544920683594, 31.2632741523437], [106.527345, 31.2877956367188], [106.513170195313, 31.2680178046876], [106.507345, 31.263843], [106.452381621094, 31.2692482734376], [106.432345, 31.2676369453125], [106.40306765625, 31.2699904609376], [106.372640410156, 31.2484181953125], [106.362066679688, 31.2492678046876], [106.334718046875, 31.2340090156251], [106.30080203125, 31.1946413398437], [106.3027746875, 31.2191921210938], [106.279947539063, 31.2284719062501], [106.267345, 31.213843], [106.259132109375, 31.2195143867188], [106.264586210938, 31.2438430000001], [106.260081816406, 31.26394065625], [106.231898222656, 31.257622296875], [106.200980253906, 31.2777565742188], [106.203465605469, 31.288843], [106.19748171875, 31.3155373359375], [106.237762480469, 31.3065065742188], [106.256363554688, 31.3789870429688], [106.311429472656, 31.3873757148438], [106.290736113281, 31.3381056953126], [106.332174101563, 31.3274709296876], [106.371556425781, 31.3440114570313], [106.381429472656, 31.3667018867188], [106.351051054688, 31.3780690742188], [106.3567590625, 31.4035353828125], [106.321429472656, 31.4279274726563], [106.313260527344, 31.4397585273438], [106.301429472656, 31.4479274726563], [106.297345, 31.463843], [106.292713652344, 31.4932326484376], [106.267191191406, 31.51085471875], [106.279845, 31.5672951484375], [106.245408964844, 31.580180890625], [106.240186796875, 31.6034743476563], [106.25201296875, 31.6206032539063], [106.281898222656, 31.640063703125], [106.302345, 31.6354811835938], [106.332345, 31.6422048164063], [106.353016386719, 31.6375710273438], [106.36435671875, 31.6539968085938], [106.393016386719, 31.6475710273438], [106.401429472656, 31.6597585273438], [106.407345, 31.6638430000001]]]]
            }
          }, {
            'type': 'Feature',
            'properties': { 'name': '营山县', 'id': '511322' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[106.913531523438, 31.3800295234376], [106.931158476563, 31.3476564765625], [106.944366484375, 31.339516828125], [106.928975859375, 31.305161359375], [106.954696074219, 31.2893141914063], [106.939993925781, 31.2683718085938], [106.953531523438, 31.2600295234376], [106.957345, 31.253843], [106.95298953125, 31.2181984687501], [106.937550078125, 31.20628440625], [106.945103789063, 31.1551760078125], [106.9226184375, 31.1175807929687], [106.88298953125, 31.08819846875], [106.843018828125, 31.0718410468751], [106.803089628906, 31.0005153632813], [106.77298953125, 30.97819846875], [106.74170046875, 30.9694875312501], [106.73298953125, 30.95819846875], [106.72170046875, 30.94948753125], [106.702884550781, 30.9180251289063], [106.673880644531, 30.922309796875], [106.667345, 30.913843], [106.652545195313, 30.9191530585937], [106.625806914063, 30.9175588203125], [106.581485625, 30.9294289375], [106.5826575, 30.94909690625], [106.57115359375, 30.9593752265626], [106.592940703125, 30.9788430000001], [106.582064238281, 30.9885622382813], [106.565482207031, 31.0071218085938], [106.480047636719, 31.0204347968751], [106.442625761719, 31.0847927070313], [106.473043242188, 31.0987526679688], [106.456783476563, 31.1132814765626], [106.431048613281, 31.1420827460937], [106.433509550781, 31.1833962226563], [106.482625761719, 31.1985622382813], [106.492064238281, 31.2191237617188], [106.502625761719, 31.2285622382812], [106.507345, 31.263843], [106.513170195313, 31.2680178046876], [106.527345, 31.2877956367188], [106.544920683594, 31.2632741523437], [106.572965117188, 31.2577321601563], [106.589522734375, 31.2808351875], [106.656112089844, 31.3010622382813], [106.712965117188, 31.289829328125], [106.741724882813, 31.3299538398438], [106.760831328125, 31.3261794257813], [106.764925566406, 31.3469020820312], [106.746827421875, 31.3754103828125], [106.78252078125, 31.3900807929688], [106.805601835938, 31.3754274726563], [106.823170195313, 31.3880178046875], [106.831519804688, 31.3996681953125], [106.867345, 31.403843], [106.873641386719, 31.3936257148438], [106.913531523438, 31.3800295234376]]]]
            }
          }, {
            'type': 'Feature',
            'properties': { 'name': '阆中市', 'id': '511381' },
            'geometry': {
              'type': 'MultiPolygon',
              'coordinates': [[[[105.907345, 31.633843], [105.910767851563, 31.6216506171875], [105.919537382813, 31.6304201484375], [105.911883574219, 31.6393044257813], [105.922894316406, 31.648452375], [105.921087675781, 31.6661672187501], [105.957345, 31.6698610664062], [105.972628203125, 31.6683034492187], [106.046776152344, 31.6999196601563], [106.062738066406, 31.6982936835937], [106.111883574219, 31.7593044257812], [106.127047148438, 31.7719020820313], [106.109940214844, 31.8017702460938], [106.122200957031, 31.8300368476563], [106.135076933594, 31.8145339179688], [106.193016386719, 31.8204396796875], [106.188968535156, 31.7807155585938], [106.212345, 31.7783327460938], [106.222345, 31.7793532539063], [106.232345, 31.7783327460938], [106.247345, 31.7798610664063], [106.262779570313, 31.7782888007813], [106.271883574219, 31.8093044257813], [106.31373171875, 31.8274562812501], [106.339420195313, 31.8583815742188], [106.352806425781, 31.8493044257813], [106.361883574219, 31.8383815742188], [106.372806425781, 31.8293044257813], [106.381883574219, 31.8083815742188], [106.397345, 31.803843], [106.401429472656, 31.7879274726563], [106.415179472656, 31.75519065625], [106.403260527344, 31.7379274726563], [106.380814238281, 31.7295290351563], [106.36047, 31.698286359375], [106.391607695313, 31.6866359687501], [106.407345, 31.6638430000001], [106.401429472656, 31.6597585273438], [106.393016386719, 31.6475710273438], [106.36435671875, 31.6539968085938], [106.353016386719, 31.6375710273438], [106.332345, 31.6422048164063], [106.302345, 31.6354811835938], [106.281898222656, 31.640063703125], [106.25201296875, 31.6206032539063], [106.240186796875, 31.6034743476563], [106.245408964844, 31.580180890625], [106.279845, 31.5672951484375], [106.267191191406, 31.51085471875], [106.292713652344, 31.4932326484376], [106.297345, 31.463843], [106.286783476563, 31.4544045234375], [106.272625761719, 31.4385622382813], [106.225975371094, 31.4241555], [106.131668730469, 31.4297780585938], [106.092625761719, 31.4085622382813], [106.050496855469, 31.3991237617188], [106.030069609375, 31.4219850898438], [105.960657988281, 31.4178493476563], [105.941041289063, 31.3751100898438], [105.920496855469, 31.3591237617188], [105.90259890625, 31.3791555], [105.8819934375, 31.3779274726563], [105.883033476563, 31.3954030585938], [105.880496855469, 31.4185622382812], [105.862254667969, 31.3981447578125], [105.852625761719, 31.4191237617188], [105.832030058594, 31.4285768867188], [105.832940703125, 31.443843], [105.831995878906, 31.4597170234375], [105.804271269531, 31.4580641914063], [105.792625761719, 31.4606911445313], [105.812830839844, 31.47874534375], [105.793121367188, 31.5150197578125], [105.822625761719, 31.5285622382813], [105.832064238281, 31.561509015625], [105.772345, 31.5579494453126], [105.752345, 31.5591408515626], [105.742166777344, 31.5585353828126], [105.697655058594, 31.5704567695313], [105.687345, 31.603843], [105.694154082031, 31.6080373359375], [105.684307890625, 31.6396486640625], [105.725155058594, 31.6648171210938], [105.717672148438, 31.688843], [105.723902617188, 31.708843], [105.720535917969, 31.7196486640625], [105.727345, 31.723843], [105.764869414063, 31.7300075507813], [105.790413847656, 31.6969118476563], [105.830260039063, 31.666157453125], [105.849127226563, 31.6200563789063], [105.868485136719, 31.6171974921875], [105.882147246094, 31.6505763984375], [105.89170046875, 31.6381984687501], [105.907345, 31.633843]]]]
            }
          }]
        }
        echarts.registerMap('nanchong', nanchongJson)
        this.chart = echarts.init(this.$el, 'macarons')
        this.setOptions()
      }
    }
  }
</script>
